package research.ui.views.comparators;

import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerComparator;

public class EntityComparator extends ViewerComparator {
	private boolean isDesc = false;

	public boolean isDesc() {
		return isDesc;
	}

	public void setDesc(boolean isDesc) {
		this.isDesc = isDesc;
	}

	@Override
	public int compare(Viewer viewer, Object e1, Object e2) {
		if (isDesc()) {
			Object e = e1;
			e1 = e2;
			e2 = e;
		}
		return super.compare(viewer, e1, e2);
	}
	
	
}
